<template>
	<view>
		<view class="u-p-b-20" v-if="list.length > 0">
			<view class="m-card m-margin" :lazy-load="true" v-for="(item, index) in list" :key="index" @click="nextNav('/pages/room/details?id=' + item.id)">
				<view class="u-flex">
					<view class="">
						<u--image :showLoading="true" :src="type === 1? yuming+item.image :item.image" width="100" height="100" :errorIcon="df"></u--image>
					</view>
					<view class="u-m-l-20">
						<view class="m-font-b u-font-36">{{ item.name }}</view>
						<view class="m-c-o u-m-t-10 m-font-b" style="color: #f36404;">{{ item.commissiontext }}</view>
						<view class="u-flex u-flex-y-center u-m-t-10">
							<view class="m-flex-no u-m-r-10 m-c-g m-font-b">{{ item.areaname }}</view>
							<view class="u-flex m-font-b m-c-h">
								<text class="u-font-28">{{ get_look_two(item.aveprice) }}元/m²</text>
								<!-- <text class="m-pf">2</text> -->
								<text class="u-font-28">-{{ get_look_two(item.avepricemax) }}元/m²</text>
								<!-- <text class="m-pf">2</text> -->
							</view>
						</view>
						<view class="u-flex u-flex-wrap" v-if="item.characteristic && type != 1">
							<view class="u-flex u-flex-wrap" v-if="JSON.parse(item.characteristic).length">
							<view class="u-m-t-10 u-m-r-10" v-if="itm" v-for="(itm, idx) in JSON.parse(item.characteristic)" :key="idx">
								<u-tag :borderColor="colorList[idx % 3]" :color="colorList[idx % 3]" :text="itm" plain size="mini"></u-tag>
							</view>
						</view>
						</view>
					</view>
				</view>
				<view :class="type === 1 ? 'u-flex u-flex-between' : ''">
					<view class="m-bg-w u-m-t-10 linehei u-flex" v-if="type === 1">
						<view class="u-flex">
							<u-icon name="eye"></u-icon>
							<text class="u-m-l-10 cor">{{item.looknum}}</text>
						</view>
						<view class="u-m-l-30 u-flex">
							<u-icon name="share-square"></u-icon>
							<text class="u-m-l-10 cor">{{item.zfnum}}</text>
						</view>
					</view>
					<view class="u-flex u-flex-x-reverse m-bg-w u-m-t-10 m-font-b"><text class="onShou">在售</text></view>
				</view>
			</view>
		</view>
		<list-empty v-else text="暂时没有数据哟!" list="data" :listHighly="listHighly"></list-empty>
	</view>
</template>

<script>
export default {
	name: 'list-group',
	data() {
		return {
			liu: 0,
			zhuan: 0
		};
	},
	props: {
		list: {
			type: Array,
			default: () => []
		},
		listHighly: {
			type: Number,
			default: 3
		},
		type: {
			type: Number,
			default: 0
		}
	}
};
</script>

<style lang="scss">
.cor {
		color: #979797;
	}

	.onShou {
		width: 120rpx;
		text-align: center;
		height: 50rpx;
		line-height: 50rpx;
		border-radius: 20rpx;
		background-color: #0e5642;
		color: #fff;
	}

	.mpmp {
		margin: 0 30rpx;
		margin-top: 20rpx;
	}

	.linehei {
		height: 50rpx;
		line-height: 50rpx;
	}
</style>
